<link href="assets/link/bootstrap-datetimepicker.min.css" rel="stylesheet">
<script src="js/proinfo/compact/contractInfoStartBSB.js"></script>
<!--main content start-->
<section id="main-content">
    <section class="wrapper">
        <!--state overview end-->
        <div class="row">
            <div class="col-lg-12">
                <section class="panel">
                    <header class="panel-heading">
                        基本信息
                    </header>
                    <div class="panel-body">

                        <div class="bio-row">
                            <p>
                                <span>项目编号</span>{{projInfo.proNo}}</p>
                        </div>
                        <div class="bio-row">
                            <p>
                                <span>项目区域</span>{{projInfo.proArea}}</p>
                        </div>
                        <div class="bio-row">
                            <p>
                                <span>项目类型</span>{{projInfo.proType}}</p>
                        </div>
                        <div class="bio-row">
                            <p>
                                <span>客户名称</span>{{projInfo.cusName}}
                            </p>
                        </div>
                        <div class="bio-row">
                            <p>
                                <span>项目名称</span>{{projInfo.proName}}</p>
                        </div>
                        <div class="bio-row">
                            <p>
                                <span>优先级 </span>{{getProjLv(projInfo.proLv)}}</p>
                        </div>
                        <div class="bio-row">
                            <p>
                                <span>目前状态 </span>{{getState(projInfo.proState)}}</p>
                        </div>
                    </div>

                </section>
                <section class="panel">
                    <header class="panel-heading">
                        合同信息
                    </header>
                    <div class="panel-body">
                        <div class="form-group customerForm">
                            <label class="col-sm-2 control-label">公司名称</label>
                            <div class="col-sm-10">
                                <select certus-required class="form-control" ng-model="contractInfo.compCode" base-company-pact="stscompSelect">
                                    <option ng-repeat="ss in contractInfo.compCodeSelect" value="{{ss.code}}">{{ss.name}}</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group customerForm">
                            <label class="col-sm-2 control-label">合同上的客户名称</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" ng-model="contractInfo.compactCusName" custom-name-list="contractInfo.compactCusId,contractInfo.compactCusName,customerId" id = 'customerId'
                                       certus-required certus-an-limit-length="50">
                            </div>
                        </div>

<!--                        <div class="form-group customerForm">-->
<!--                            <label class="col-sm-2 control-label">我司签约公司</label>-->
<!--                            <div class="col-sm-10">-->
<!--                                <input type="text" value="" class="form-control" ng-model="contractInfo.contractSubject"-->
<!--                                       certus-required certus-an-limit-length="50">-->
<!--                            </div>-->
<!--                        </div>-->
                        <div class="form-group customerForm">
                            <label class="col-sm-2 control-label">合同编号</label>
                            <div class="col-sm-10">
                                <input type="text" value="" class="form-control" certus-required
                                       ng-model="contractInfo.contractNo" certus-an-limit-length="50"
                                       disabled placeholder="合同上的编号。若没有，建议使用客户名称加合同签订日期(年月日)输入，(50字以内)">
                            </div>
                        </div>

<!--                        <div class="form-group customerForm">-->
<!--                            <label class="col-sm-2 control-label">合同性质</label>-->
<!--                            <div class="col-sm-10">-->
<!--                                <select certus-required class="form-control" ng-model="contractInfo.characterCA">-->
<!--                                    <option-->
<!--                                            ng-repeat="xs in [{'name':'集成类','code':'集成类'},{'name':'非集成类','code':'非集成类'}]"-->
<!--                                            value="{{xs.code}}">-->
<!--                                        {{xs.name}}-->
<!--                                    </option>-->
<!--                                </select>-->
<!--                            </div>-->
<!--                        </div>-->
                        <div class="form-group customerForm">
                            <label class="col-sm-2 control-label">合同名称</label>
                            <div class="col-sm-10">
                                <input type="text" value="" class="form-control" certus-required
                                       ng-model="contractInfo.contractName" certus-an-limit-length="50"
                                       placeholder="可以使用客户名称和合同名称">
                            </div>
                        </div>
                        <div class="form-group customerForm">
                            <label class="col-sm-2 control-label">签订人(我司签订人)</label>
                            <div class="col-sm-10">
                                <input type="text" value="" class="form-control" ng-model="contractInfo.contractSigner"
                                       certus-an-limit-length="50" placeholder="可以使用客户名称和合同名称">
                            </div>
                        </div>
<!--                        <div class="form-group customerForm">-->
<!--                            <label class="col-sm-2 control-label">销售内部编号</label>-->
<!--                            <div class="col-sm-10">-->
<!--                                <input type="text" value="" class="form-control"-->
<!--                                       ng-model="contractInfo.salesInternalCode"-->
<!--                                       certus-an-limit-length="50" placeholder="如果填写销售内部编号，销售内部编号不能重复">-->
<!--                            </div>-->
<!--                        </div>-->
                        <!--<div class="form-group customerForm">-->
                            <!--<label class="col-sm-2 control-label">财务编号</label>-->
                            <!--<div class="col-sm-10">-->
                                <!--<input type="text" value="" class="form-control" placeholder="如果填写财务编号，财务编号不能重复"-->
                                       <!--ng-model="contractInfo.financialCode" certus-an-limit-length="50">-->
                            <!--</div>-->
                        <!--</div>-->
                        <div class="form-group customerForm">
                            <label class="col-sm-2 control-label">合同金额*</label>
                            <div class="col-sm-10">
                                <div class="input-group m-bot15">
                                    <span class="input-group-addon">￥</span>
                                    <input type="text" certus-an-limit-length-num="50" certus-required
                                           class="form-control" ng-model="contractInfo.contractAmount">
                                    <span class="input-group-addon">.00 元</span>
                                </div>
                            </div>
                        </div>
<!--                        <div class="form-group customerForm">-->
<!--                            <label class="col-sm-2 control-label">软件收入金额</label>-->
<!--                            <div class="col-sm-10">-->
<!--                                <div class="input-group m-bot15">-->
<!--                                    <span class="input-group-addon">￥</span>-->
<!--                                    <input type="text" certus-an-limit-length-num="50" class="form-control"-->
<!--                                           ng-model="contractInfo.softIncome">-->
<!--                                    <span class="input-group-addon">.00 元</span>-->
<!--                                </div>-->
<!--                            </div>-->
<!--                        </div>-->
<!--                        <div class="form-group customerForm">-->
<!--                            <label class="col-sm-2 control-label">非软件收入金额</label>-->
<!--                            <div class="col-sm-10">-->
<!--                                <div class="input-group m-bot15">-->
<!--                                    <span class="input-group-addon">￥</span>-->
<!--                                    <input type="text" certus-an-limit-length-num="50" class="form-control"-->
<!--                                           ng-model="contractInfo.notSoftIncome">-->
<!--                                    <span class="input-group-addon">.00 元</span>-->
<!--                                </div>-->
<!--                            </div>-->
<!--                        </div>-->
<!--                        <div class="form-group customerForm">-->
<!--                            <label class="col-sm-2 control-label">合同签订时间</label>-->
<!--                            <div class="col-sm-10">-->
<!--                                <input id="time-3" type="text" certus-required class="form-control"-->
<!--                                       ng-model="contractInfo.contractSignTime">-->
<!--                            </div>-->
<!--                        </div>-->
<!--                        <div class="form-group customerForm">-->
<!--                            <label class="col-sm-2 control-label">交付时间</label>-->
<!--                            <div class="col-sm-10">-->
<!--                                <input id="time-1" type="text" certus-required class="form-control"-->
<!--                                       ng-model="contractInfo.deliveryTime">-->
<!--                            </div>-->
<!--                        </div>-->
<!--                        <div class="form-group customerForm">-->
<!--                            <label class="col-sm-2 control-label">最终结算日期</label>-->
<!--                            <div class="col-sm-10">-->
<!--                                <input id="time-2" type="text" class="form-control" ng-model="contractInfo.finalDate">-->
<!--                            </div>-->
<!--                        </div>-->
<!--                        <div class="form-group customerForm">-->
<!--                            <label class="col-sm-2 control-label">交付地</label>-->
<!--                            <div class="col-sm-10">-->
<!--                                <input type="text" certus-required certus-an-limit-length="50" class="form-control"-->
<!--                                       ng-model="contractInfo.deliveryTo">-->
<!--                            </div>-->
<!--                        </div>-->
<!--                        <div class="form-group customerForm">-->
<!--                            <label class="col-sm-2 control-label">合同关键条款</label>-->
<!--                            <div class="col-sm-10">-->
<!--                                <textarea class="form-control" maxlength="120" certus-required-->
<!--                                          certus-an-limit-length="50"-->
<!--                                          ng-model="contractInfo.keyTerms" disabled></textarea>-->
<!--                            </div>-->
<!--                        </div>-->
                        <div class="form-group customerForm">
                            <label class="col-sm-2 control-label">申请说明</label>
                            <div class="col-sm-10">
                                <textarea class="form-control" maxlength="120" certus-required
                                          certus-an-limit-length="50"
                                          ng-model="contractInfo.applyInstruction" disabled></textarea>
                            </div>
                        </div>


<!--                        <div class="form-group customerForm">-->
<!--                            <label class="col-sm-2 control-label">付款条款*</label>-->
<!--                            <div class="col-sm-10">-->
<!--                                <div class="input-group m-bot15">-->
<!--                                    <span class="input-group-addon">首付款</span>-->
<!--                                    <input type="text" certus-an-limit-length-num="5"-->
<!--                                           ng-change="moneyChange(contractInfo.preliminaryInspection,'#time-11','initialPayment')"-->
<!--                                           certus-required class="form-control"-->
<!--                                           ng-model="contractInfo.initialPayment">-->
<!--                                    <span class="input-group-addon">%</span>-->
<!--                                </div>-->
<!--                            </div>-->
<!--                        </div>-->

<!--                        <div class="form-group customerForm"-->
<!--                             ng-if="contractInfo.initialPayment && contractInfo.initialPayment > 0.00">-->
<!--                            <label class="col-sm-2 control-label">首付款日期</label>-->
<!--                            <div class="col-sm-10">-->
<!--                                <input id="time-11" onfocus="initDate(this,'#time-11','initialPayment')"-->
<!--                                       ocus="initDate('#time-11','initialPayment')" type="text" class="form-control"-->
<!--                                       onkeydown="return banInputSapce(event);"-->
<!--                                       ng-model="contractInfo.initialPaymentDate" certus-required>-->
<!--                            </div>-->
<!--                        </div>-->

<!--                        <div class="form-group customerForm">-->
<!--                            <label class="col-sm-2 control-label"></label>-->
<!--                            <div class="col-sm-10">-->
<!--                                <div class="input-group m-bot15">-->
<!--                                    <span class="input-group-addon">初验</span>-->
<!--                                    <input type="text" certus-an-limit-length-num="5" certus-required-->
<!--                                           class="form-control"-->
<!--                                           ng-model="contractInfo.preliminaryInspection"-->
<!--                                           ng-change="moneyChange(contractInfo.preliminaryInspection,'#time-12','preliminaryInspection')">-->
<!--                                    <span class="input-group-addon">%</span>-->
<!--                                </div>-->
<!--                            </div>-->
<!--                        </div>-->

<!--                        <div class="form-group customerForm"-->
<!--                             ng-if="contractInfo.preliminaryInspection && contractInfo.preliminaryInspection > 0.00">-->
<!--                            <label class="col-sm-2 control-label">初验日期</label>-->
<!--                            <div class="col-sm-10">-->
<!--                                <input id="time-12" type="text"-->
<!--                                       onfocus="initDate(this,'#time-12','preliminaryInspection')" class="form-control"-->
<!--                                       onkeydown="return banInputSapce(event);"-->
<!--                                       ng-model="contractInfo.preliminaryInspectionDate" certus-required>-->
<!--                            </div>-->
<!--                        </div>-->

<!--                        <div class="form-group customerForm">-->
<!--                            <label class="col-sm-2 control-label"></label>-->
<!--                            <div class="col-sm-10">-->
<!--                                <div class="input-group m-bot15">-->
<!--                                    <span class="input-group-addon">终验</span>-->
<!--                                    <input type="text" certus-an-limit-length-num="5"-->
<!--                                           ng-change="moneyChange(contractInfo.preliminaryInspection,'#time-13','finalAcceptance')"-->
<!--                                           certus-required class="form-control"-->
<!--                                           ng-model="contractInfo.finalAcceptance">-->
<!--                                    <span class="input-group-addon">%</span>-->
<!--                                </div>-->
<!--                            </div>-->
<!--                        </div>-->

<!--                        <div class="form-group customerForm"-->
<!--                             ng-if="contractInfo.finalAcceptance && contractInfo.finalAcceptance > 0.00">-->
<!--                            <label class="col-sm-2 control-label">终验日期</label>-->
<!--                            <div class="col-sm-10">-->
<!--                                <input id="time-13" type="text" class="form-control"-->
<!--                                       onfocus="initDate(this,'#time-13','finalAcceptance')"-->
<!--                                       onkeydown="return banInputSapce(event);"-->
<!--                                       ng-model="contractInfo.finalAcceptanceDate" certus-required>-->
<!--                            </div>-->
<!--                        </div>-->

<!--                        <div class="form-group customerForm">-->
<!--                            <label class="col-sm-2 control-label"></label>-->
<!--                            <div class="col-sm-10">-->
<!--                                <div class="input-group m-bot15">-->
<!--                                    <span class="input-group-addon">尾款</span>-->
<!--                                    <input type="text" certus-an-limit-length-num="5"-->
<!--                                           ng-change="moneyChange(contractInfo.preliminaryInspection,'#time-14','finalPayment')"-->
<!--                                           certus-required class="form-control"-->
<!--                                           ng-model="contractInfo.finalPayment">-->
<!--                                    <span class="input-group-addon">%</span>-->
<!--                                </div>-->
<!--                            </div>-->
<!--                        </div>-->

<!--                        <div class="form-group customerForm"-->
<!--                             ng-if="contractInfo.finalPayment && contractInfo.finalPayment > 0.00">-->
<!--                            <label class="col-sm-2 control-label">尾款日期</label>-->
<!--                            <div class="col-sm-10">-->
<!--                                <input id="time-14" type="text" class="form-control"-->
<!--                                       onfocus="initDate(this,'#time-14','finalPayment')"-->
<!--                                       onkeydown="return banInputSapce(event);"-->
<!--                                       ng-model="contractInfo.finalPaymentDate" certus-required>-->
<!--                            </div>-->
<!--                        </div>-->


<!--                        &lt;!&ndash; <div class="col-sm-12">-->
<!--                            <label class="col-sm-2 control-label">付款条款*</label>-->
<!--                            <ul>-->
<!--                                <li>-->
<!--                                    <div class="input-group m-bot15">-->
<!--                                        <span class="input-group-addon">首付款</span>-->
<!--                                        <input type="text" certus-required certus-an-limit-length="50"-->
<!--                                            class="form-control" ng-model="contractInfo.initialPayment" disabled>-->
<!--                                        <span class="input-group-addon">%</span>-->
<!--                                    </div>-->

<!--                                </li>-->
<!--                                <label class="col-sm-2 control-label"></label>-->
<!--                                <li>-->
<!--                                    <div class="input-group m-bot15">-->
<!--                                        <span class="input-group-addon">初验*</span>-->
<!--                                        <input type="text" certus-required certus-an-limit-length-num="50"-->
<!--                                            class="form-control" ng-model="contractInfo.preliminaryInspection" disabled>-->
<!--                                        <span class="input-group-addon">%</span>-->
<!--                                    </div>-->
<!--                                </li>-->
<!--                                <label class="col-sm-2 control-label"></label>-->
<!--                                <li>-->
<!--                                    <div class="input-group m-bot15">-->
<!--                                        <span class="input-group-addon">终验*</span>-->
<!--                                        <input type="text" certus-required certus-an-limit-length-num="50"-->
<!--                                            class="form-control" ng-model="contractInfo.finalAcceptance" disabled>-->
<!--                                        <span class="input-group-addon">%</span>-->
<!--                                    </div>-->
<!--                                </li>-->
<!--                                <label class="col-sm-2 control-label"></label>-->
<!--                                <li>-->
<!--                                    <div class="input-group m-bot15">-->
<!--                                        <span class="input-group-addon">尾款*</span>-->
<!--                                        <input type="text" certus-required certus-an-limit-length-num="50"-->
<!--                                            class="form-control" ng-model="contractInfo.finalPayment" disabled>-->
<!--                                        <span class="input-group-addon">%</span>-->
<!--                                    </div>-->
<!--                                </li>-->
<!--                            </ul>-->
<!--                        </div> &ndash;&gt;-->

<!--                        <div class="form-group customerForm">-->
<!--                            <label class="col-sm-2 control-label">合同份数*</label>-->
<!--                            <div class="col-sm-10">-->
<!--                                <input type="text" value="" class="form-control"-->
<!--                                       certus-an-limit-length-int="50" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"-->
<!--                                       ng-model="contractInfo.contractNumber" disabled>-->
<!--                            </div>-->
<!--                        </div>-->


                        <div class="form-group customerForm">
                            <label class="col-sm-2 control-label">退回说明</label>
                            <div class="col-sm-10">
                                <textarea class="form-control" maxlength="120" ng-model="contractInfo.opinionMsg"
                                          disabled></textarea>
                            </div>
                        </div>


                    </div>
                </section>

                <section class="panel">
                    <div class="panel-body">
                        <p class="default-buttons">
                            <a href="javascript:void(0);" class="button-back btn btn-info"
                               onclick="window.history.back()">返回</a>
                            <a href="javascript:void(0);" class="button-next  btn btn-success"
                               ng-click="contractInfoApproval()">确认提交</a>
                        </p>
                    </div>
                </section>
            </div>
        </div>
    </section>
</section>

<script>
    var picker1 = $('#time-1').datetimepicker({
        format: 'YYYY-MM-DD',
        locale: moment.locale('zh-cn')
    }).on('dp.change', function (e) {
        var result = new moment(e.date).format('YYYY-MM-DD');
        if (result && !angular.isUndefined(result)) {
            $$scope.contractInfo.deliveryTime = result;
            $$scope.$apply();
        }
    })
    var picker2 = $('#time-2').datetimepicker({
        format: 'YYYY-MM-DD',
        locale: moment.locale('zh-cn')
    }).on('dp.change', function (e) {
        var result = new moment(e.date).format('YYYY-MM-DD');
        if (result && !angular.isUndefined(result)) {
            $$scope.contractInfo.finalDate = result;
            $$scope.$apply();
        }
    })
    var picker3 = $('#time-3').datetimepicker({
        format: 'YYYY-MM-DD',
        locale: moment.locale('zh-cn')
    }).on('dp.change', function (e) {
        var result = new moment(e.date).format('YYYY-MM-DD');
        if (result && !angular.isUndefined(result)) {
            $$scope.contractInfo.contractSignTime = result;
            $$scope.$apply();
        }
    })
</script>